home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
CRS
/
crs06.d81
/
moresmrt.arc
/
WRITE
(
.txt
)
< prev
Wrap
GEOS ConVerT
|
2009-10-10
|
6KB
|
254 lines
Write
PRG formatted GEOS file V1.0
NX1000
WRITE
BLASTER'S CONVERTER V2.5
READ ME FIRST
Write Image V2.0
geoWrite V2.1
@write
clock
.if Pass1
.include geosSym
.include geosMac
.endif
.psect
ProgStart: jsr DayofWeek
PushB CPU_DATA ;save
config
LoadB CPU_DATA,#$35 ;turn
region
sei ;int
MoveB cia1base,a0L ;save
MoveB $DC02,a0H ;save
LoadB $DC02,#$0F ;new
configuration all
o/p's
LoadB cia1base,#$0E ;initial
state
i/o all
lines
false
jsr SelClock ;select
clock
MoveW $DC0B,a1L ;read
hours
TOD temp store
lsr a
lsr a ;bring
place
and #$20 ;isolate
ora a1L ;retrieve
hours
and #$3F ;clear
msb's
ora #$80 ;set
12/24
sta tmphrs ;save
hours
MoveW $DC09,tmpsecs ;read
MoveW $DC0A,tmpmins ;read
minutes
lda $DC08 ;read
secs/10
close
jsr WriteByte ;write
lda tmpsecs ;read
seconds
jsr WriteByte
lda tmpmins ;read
minutes
jsr WriteByte
lda tmphrs ;retrieve
hours
jsr WriteByte
lda dayowk ;read
day of week
jsr WriteByte
lda day ;read
jsr HextoBCD ;convert
jsr WriteByte
lda month ;read
month
jsr HextoBCD ;convert
jsr WriteByte
lda year ;read
jsr HextoBCD ;convert
jsr WriteByte
MoveB a0L,cia1base ;restore
MoveB a0H,$DC02 ;restore
PopB CPU_DATA ;restore
config
jmp EnterDeskTop ;reload
desktop
@;write
WriteByte: tax ;save
ldy #8 ;set
count
LoadB cia1base,#$0C ;initial
config output
enable
txa ;retrieve
@;write
WriteByte: tax ;save
ldy #8 ;set
count
LoadB cia1base,#$0C ;initial
config output
enable
txa ;retrieve
10$: and #1 ;clr
sta cia1base
ora #$0C ;write
sta cia1base
dey ;decrement
count
beq 20$ ;finished?
txa ;get
lsr a ;select
tax ;save
again
bra 10$ ;loop
20$: rts
@;hex
convert
routine
HextoBCD: ldx #0 ;clear
10$: sta a1H ;save
value
sec ;set
carry
sbc #$0A ;subtract
bmi 20$ ;neg?...it's
inx ;inc
bra 10$ ;loop
20$: txa ;count
asl a
asl a
asl a
asl a ;shift
nibble
nibble
ora a1H ;assemble
@;select
clock
SelClock: lda #$0E ;read
cycle
start
dallas
sta cia1base
lda #2
sta cia1base
lda #$0E
sta cia1base
LoadB a2,#2 ;loop
count
10$: lda #$C5
jsr WriteByte
lda #$3A
jsr WriteByte
lda #$A3
jsr WriteByte
lda #$5C
jsr WriteByte
dec a2 ;decrement
count
bne 10$
@;ask user for day of week
DayofWeek: LoadW r0,#DoWBox
jsr DoDlgBox
sbc #10
sta dayowk
DoWBox: .byte DEF_DB_POS | 1
.byte DBTXTSTR,16,18
.word dwtext
.byte DBTXTSTR,26,31
@;ask user for day of week
DayofWeek: LoadW r0,#DoWBox
jsr DoDlgBox
sbc #10
sta dayowk
DoWBox: .byte DEF_DB_POS | 1
.byte DBTXTSTR,16,18
.word dwtext
.byte DBTXTSTR,26,31
.word suntext
.byte DBTXTSTR,138,31
.word montext
.byte DBTXTSTR,26,45
.word tuetext
.byte DBTXTSTR,138,45
.word wedtext
.byte DBTXTSTR,26,59
.word thutext
.byte DBTXTSTR,138,59
.word fritext
.byte DBTXTSTR,90,73
.word sattext
.byte DBUSRICON,2,24
.word sunicontbl
.byte DBUSRICON,16,24
.word monicontbl
.byte DBUSRICON,2,38
.word tueicontbl
.byte DBUSRICON,16,38
.word wedicontbl
.byte DBUSRICON,2,52
.word thuicontbl
.byte DBUSRICON,16,52
.word friicontbl
.byte DBUSRICON,10,66
.word saticontbl
.byte 0
dwtext: .byte BOLDON,"Select Day of Week",PLAINTEXT,0
suntext: .byte "Sun",0
montext: .byte "Mon",0
tuetext: .byte "Tues",0
wedtext: .byte "Wed",0
thutext: .byte "Thurs",0
fritext: .byte "Fri",0
sattext: .byte "Sat",0
sunicontbl: .word boxicon
.byte 0,0,1,8
.word SunRtn
monicontbl: .word boxicon
.byte 0,0,1,8
.word MonRtn
tueicontbl: .word boxicon
.byte 0,0,1,8
.word TueRtn
wedicontbl: .word boxicon
.byte 0,0,1,8
.word WedRtn
thuicontbl: .word boxicon
.byte 0,0,1,8
.word ThuRtn
friicontbl: .word boxicon
.byte 0,0,1,8
.word FriRtn
saticontbl: .word boxicon
.byte 0,0,1,8
.word SatRtn
boxicon:
@;dialog box dispatch routines
SunRtn: LoadB sysDBData,#11
jmp RstrFrmDialogue
MonRtn: LoadB sysDBData,#12
jmp RstrFrmDialogue
TueRtn: LoadB sysDBData,#13
jmp RstrFrmDialogue
WedRtn: LoadB sysDBData,#14
jmp RstrFrmDialogue
ThuRtn: LoadB sysDBData,#15
jmp RstrFrmDialogue
FriRtn: LoadB sysDBData,#16
jmp RstrFrmDialogue
SatRtn: LoadB sysDBData,#17
jmp RstrFrmDialogue
tmphrs: .block 1
tmpsecs: .block 1
tmpmins: .block 1
dayowk: .block 1
]`323333333333
]`191010110101